<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>Theron: THERON_PREALIGN</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Theron
   &#160;<span id="projectnumber">6.00.02</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_856524284ebe840938865dc061f982fb.html">Include</a></li><li class="navelem"><a class="el" href="dir_7c463a385af7963c97ef4a23e37c5d06.html">Theron</a></li><li class="navelem"><a class="el" href="Align_8h.html">Align.h</a></li>  </ul>
</div>
</div><!-- top -->
<div class="contents">
<table cellspacing="0" cellpadding="0" border="0">
  <tr>
   <td valign="top">
      <div class="navtab">
        <table>
          <tr><td class="navtab"><a class="qindex" href="Align_8h_af2cc57ef1afc7508e07cf25adec9bd9b.html#af2cc57ef1afc7508e07cf25adec9bd9b">THERON_ALIGN</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="Align_8h_afde36f5f326cb238a9c56c09bcc1bcab.html#afde36f5f326cb238a9c56c09bcc1bcab">THERON_ALIGN_ACTOR</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="Align_8h_ac85c549d2873f38d3bfa43ab7926bf45.html#ac85c549d2873f38d3bfa43ab7926bf45">THERON_ALIGN_MESSAGE</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="Align_8h_aa86be845f4b9d38ff257ea574513e814.html#aa86be845f4b9d38ff257ea574513e814">THERON_ALIGNED</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="Align_8h_ace9b78c6c93283250d6fa9b2b4f846d2.html#ace9b78c6c93283250d6fa9b2b4f846d2">THERON_ALIGNOF</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="Align_8h_a6b92e21cf2b0c773b4a052bf6607a571.html#a6b92e21cf2b0c773b4a052bf6607a571">THERON_POSTALIGN</a></td></tr>
          <tr><td class="navtab"><a class="qindexHL" href="Align_8h_aab2275e2ca1403d2b6ad6f4799d78638.html#aab2275e2ca1403d2b6ad6f4799d78638">THERON_PREALIGN</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="Align_8h_aa13ea2847e77501c84f513c5c02f6ddf.html#aa13ea2847e77501c84f513c5c02f6ddf">THERON_ROUNDUP</a></td></tr>
        </table>
      </div>
   </td>
   <td valign="top" class="mempage">
<a class="anchor" id="aab2275e2ca1403d2b6ad6f4799d78638"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define THERON_PREALIGN</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">alignment</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Informs the compiler of the stack alignment requirements of a type. </p>
<p>First of two macros that can be used together when defining a class to inform the compiler of the alignment requirements of the class. This causes the compiler to automatically align instances of the class when they are allocated on the stack (for example, when used as local variables within user functions).</p>
<div class="fragment"><div class="line"><span class="preprocessor">#if defined(_MSC_VER)</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#pragma warning( disable : 4324 )</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif // _MSC_VER</span></div>
<div class="line"><span class="preprocessor"></span></div>
<div class="line"><span class="comment">// A message type that requires alignment.</span></div>
<div class="line"><span class="keyword">struct </span><a class="code" href="Align_8h_aab2275e2ca1403d2b6ad6f4799d78638.html#aab2275e2ca1403d2b6ad6f4799d78638">THERON_PREALIGN</a>(128) AlignedMessage</div>
<div class="line">{</div>
<div class="line">    <span class="keywordtype">int</span> mValue;</div>
<div class="line">    </div>
<div class="line">} <a class="code" href="Align_8h_a6b92e21cf2b0c773b4a052bf6607a571.html#a6b92e21cf2b0c773b4a052bf6607a571">THERON_POSTALIGN</a>(128);</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">int</span> main()</div>
<div class="line">{</div>
<div class="line">    AlignedMessage message;  <span class="comment">// Aligned to 128 bytes by the compiler</span></div>
<div class="line">}</div>
</div><!-- fragment --><p> The reason for using two macros is for portability: some compilers differ on whether the alignment decoration comes before or after the type definition. At present the supported compilers all accept the decoration before the definition.</p>
<p>The THERON_PREALIGN and THERON_POSTALIGN macros don't actually affect <a class="el" href="namespaceTheron.html" title="Main namespace containing all public API components. ">Theron</a> at all, because <a class="el" href="namespaceTheron.html" title="Main namespace containing all public API components. ">Theron</a> never allocates user message types on the stack. They are provided only for user convenience. Users with types that require alignment can use these macros to cause those types to be aligned correctly when used on the stack in their own code. Many users with aligned types will of course already have their own similar mechanism, and if so they can ignore THERON_PREALIGN and THERON_POSTALIGN.</p>
<p>In any event users with message types requiring alignment should remember to also use the <a class="el" href="Align_8h_ac85c549d2873f38d3bfa43ab7926bf45.html#ac85c549d2873f38d3bfa43ab7926bf45">THERON_ALIGN_MESSAGE</a> macro, which does affect <a class="el" href="namespaceTheron.html" title="Main namespace containing all public API components. ">Theron</a> and is important for ensuring that message copies allocated internally within <a class="el" href="namespaceTheron.html" title="Main namespace containing all public API components. ">Theron</a> are correctly aligned.</p>
<p>This macro can be overridden, for example with a custom implementation for a different compiler, by defining it in a local header included in user code before any <a class="el" href="namespaceTheron.html" title="Main namespace containing all public API components. ">Theron</a> headers.</p>
<dl class="section note"><dt>Note</dt><dd>You may need to disable warning C4324 in Visual C++ builds when using this macro. </dd>
<dd>
If you use this macro, you should also use <a class="el" href="Align_8h_a6b92e21cf2b0c773b4a052bf6607a571.html#a6b92e21cf2b0c773b4a052bf6607a571">THERON_POSTALIGN</a> for portability.</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="Align_8h_a6b92e21cf2b0c773b4a052bf6607a571.html#a6b92e21cf2b0c773b4a052bf6607a571" title="Informs the compiler of the stack alignment requirements of a type. ">THERON_POSTALIGN</a> </dd></dl>

</div>
</div>
    </td>
  </tr>
</table>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
